import xml.sax.handler
import xml.sax

class VulnHandler(xml.sax.ContentHandler):
    
    def startDocument(self):
        self.seen = {}
    
    def startElement(self, tag, attributes):
        ##print "Debug: " + tag
        if tag != 'test': return
        
        value = attributes.get('status')
        ##print "Debug: " + "value = " + value        

        if value == "vulnerable-version" or value == "vulnerable-exploited":
            print "Vulnerable ID: " + attributes.get('id');

p = xml.sax.make_parser()
p.setContentHandler(VulnHandler())

f = open("report.xml",mode='r')

while True:
    data = f.read(8096)
    if not data: break
    p.feed(data)
p.close()
